<template style="color: black">
  <div style="margin-top: 1.5%">
    <div class="sidebar">
      <!-- 跳转到指定模块 -->
      <el-card class="btn-box">
        <el-button
          style="margin-left: 10px"
          @click="ding"
        >跌倒/坠床后生命体征
        </el-button>
        <el-button
          @click="goAssignBlock('block'+ 1,20)"
        >跌倒/坠床造成的伤害
        </el-button>
        <el-button
          @click="goAssignBlock('block'+ 2,20)"
        >跌倒/坠床其他情况
        </el-button>
        <el-button
          @click="goAssignBlock('block'+ 3,20)"
        >事件情况描述
        </el-button>
        <el-button
          @click="goAssignBlock('block'+ 4,20)"
        >患者资料
        </el-button>
        <el-button
          @click="goAssignBlock('block'+ 5,20)"
        >事件基本信息
        </el-button>
        <el-button
          @click="goAssignBlock('block'+ 6,20)"
        >当事人资料
        </el-button>
        <el-button
          @click="goAssignBlock('block'+ 7,20)"
        >事件结果
        </el-button>
        <el-button
          @click="goAssignBlock('block'+ 8,20)"
        >报告者信息
        </el-button>
      </el-card>
    </div>
    <div class="content">
      <!--      手风琴效果-->
      <el-collapse style=" margin-left: 8%;" v-model="activeNames">
        <!--跌倒/坠床后生命体征-->
        <!--        定位-->
        <div ref="block0"></div>
        <!--        手风琴效果-->
        <el-collapse-item name="1">
          <template #title>
            <div class="shaodiedaobname">跌倒/坠床后生命体征</div>
          </template>
          <div class="block" style="margin-top: 0.5%;">
<!--            定义生命体征表单-->
            <el-form ref="basictizhengform" :model="basicForm" :rules="tizhengrules" label-width="140px">
              <el-form-item label="T(体温)" style="width: 620px" prop="fallTemperature" >
                <div style="display: flex">
                  <el-input v-model="basicForm.fallTemperature"></el-input>
                  <span
                    style="margin-left:10px; float:right; font-weight:bolder;width: 110px">℃(35.0℃~42.0℃)</span>
                </div>
              </el-form-item>
              <el-form-item label="P(脉搏)" style="width: 600px;margin-top: 15px" prop="fallPulse">
                <div style="display: flex">
                  <el-input v-model="basicForm.fallPulse"></el-input>
                  <span style="margin-left:10px; float:right; font-weight:bolder;width: 110px">次/分</span>
                </div>
              </el-form-item>
              <el-form-item label="R(呼吸)" style="width: 600px;margin-top: 15px" prop="fallBreathe">
                <div style="display: flex">
                  <el-input v-model="basicForm.fallBreathe"></el-input>
                  <span style="margin-left:10px; float:right; font-weight:bolder;width: 110px">次/分</span>
                </div>
              </el-form-item>
              <el-form-item label="BP(血压)" style="width: 900px;margin-top: 15px" prop="fallBloodPressure">
                <div style="display: flex">
                  <el-input v-model="basicForm.fallBloodPressure"></el-input>
                  <span style="margin-left:10px; float:right; font-weight:bolder; width: 800px ">mmHg(请分别输入高低压用“/”隔开/.如 120/90)</span>
                </div>
              </el-form-item>
              <el-form-item label="意识状态">
                <el-radio-group v-model="basicForm.fallStateConsciousness">
                  <el-radio label="01">清醒</el-radio>
                  <el-radio label="02">嗜睡</el-radio>
                  <el-radio label="03">昏睡</el-radio>
                  <el-radio label="04">浅昏迷</el-radio>
                  <el-radio label="05">中昏迷</el-radio>
                  <el-radio label="06">深昏迷</el-radio>
                  <el-radio label="07">烦躁</el-radio>
                  <el-radio label="08">焦虑</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-form>

          </div>
        </el-collapse-item>
        <!--        用于点击左侧目录来定位-->
        <div ref="block1"></div>
        <el-collapse-item name="2">
          <template #title>
            <div class="shaodiedaobname">跌倒/坠床造成的伤害</div>
          </template>
          <div class="block" style="margin-top: 0.5%;">
<!--            造成的伤害表单-->
            <el-form ref="basichurtform" :model="basicForm" :rules="hurtrules" label-width="140px">
              <el-form-item label="造成的伤害">
                <el-radio-group v-model="basicForm.fallDamageCaused">
                  <el-radio label="01">无伤害</el-radio>
                  <el-radio label="02">擦伤</el-radio>
                  <el-radio label="03">淤血</el-radio>
                  <el-radio label="04">撕裂伤</el-radio>
                  <el-radio label="05">骨折</el-radio>
                  <el-radio label="06">头部损伤</el-radio>
                  <el-radio label="07">死亡</el-radio>
                  <el-radio label="08">其他</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item v-if="basicForm.fallDamageCaused!='01'" label="部位" style="width: 600px" prop="fallPlace">
                <el-input v-model="basicForm.fallPlace"></el-input>
              </el-form-item>
              <el-form-item v-if="basicForm.fallDamageCaused!='01'" label="面积" style="width: 600px;margin-top: 15px" prop="fallArea">
                <el-input v-model="basicForm.fallArea"></el-input>
              </el-form-item>
            </el-form>
          </div>
        </el-collapse-item>

        <!--        用于定位-->
        <div ref="block2"></div>
        <el-collapse-item name="3">
          <template #title>
            <div class="shaodiedaobname">跌倒/坠床其他情况</div>
          </template>
          <div class="block" style="margin-top: 0.5%;">
<!--            其他情况表单-->
            <el-form ref="basicqingkuangform" :model="basicForm" :rules="qingkuangrules" label-width="140px">
              <div style="color:blue;margin-top: 1%;font-size: 14px">跌倒/坠床时情形：
              </div>
              <el-form-item label="跌倒/坠床时位置">
                <el-radio-group v-model="basicForm.fallPosition">
                  <el-radio label="01">床边</el-radio>
                  <el-radio label="02">病室内</el-radio>
                  <el-radio label="03">卫生间</el-radio>
                  <el-radio label="04">楼道</el-radio>
                  <el-radio label="05">院外</el-radio>
                  <el-radio label="06">其他</el-radio>
                </el-radio-group>
              </el-form-item>
              <div v-show="basicForm.drugReaction1== '其他'">
                <el-form-item label="其他" style="width: 600px">
                  <el-input v-model="basicForm.undesc"></el-input>
                </el-form-item>
              </div>
              <el-form-item label="跌倒/坠床前患者活动能力">
                <el-radio-group v-model="basicForm.fallMobility">
                  <el-radio label="01">活动自如</el-radio>
                  <el-radio label="02">卧床不起</el-radio>
                  <el-radio label="03">需要手杖辅具</el-radio>
                  <el-radio label="04">需要轮椅辅具</el-radio>
                  <el-radio label="05">需要助行器辅具</el-radio>
                  <el-radio label="06">需要假肢辅具</el-radio>
                </el-radio-group>
              </el-form-item>

              <el-form-item label="治疗情况" prop="bedTreatmentConditions">
                <el-checkbox-group v-model="checkList" @change="outputSelectedValues(checkList)">
                  <el-checkbox label="01">无治疗</el-checkbox>
                  <el-checkbox label="02">禁食</el-checkbox>
                  <el-checkbox label="03">输液</el-checkbox>
                  <el-checkbox label="04">引流管</el-checkbox>
                  <el-checkbox label="05">灌肠后</el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <el-form-item label="跌倒/坠床前发生于何项活动过程">
                <el-radio-group v-model="basicForm.fallActivityProcess">
                  <el-radio label="01">躺卧病床</el-radio>
                  <el-radio label="02">上下病床</el-radio>
                  <el-radio label="03">坐床旁椅</el-radio>
                  <el-radio label="04">如厕</el-radio>
                  <el-radio label="05">沐浴时</el-radio>
                  <el-radio label="06">站立</el-radio>
                  <el-radio label="07">行走时</el-radio>
                  <el-radio label="08">上下平车</el-radio>
                  <el-radio label="09">坐轮椅</el-radio>
                  <el-radio label="10">上下诊床</el-radio>
                  <el-radio label="11">使用电梯时</el-radio>
                  <el-radio label="12">从事康复活动时</el-radio>
                  <el-radio label="13">其他</el-radio>
                </el-radio-group>
              </el-form-item>
              <div v-show="basicForm.drugReaction2== '其他'">
                <el-form-item label="其他" style="width: 600px">
                  <el-input v-model="basicForm.undesc"></el-input>
                </el-form-item>
              </div>
              <div style="color:blue;margin-top: 1%;font-size: 14px">跌倒/坠床危险因素：
              </div>
              <el-form-item label="既往史" prop="fallAnamnesis" style="width: 600px">
                <el-input placeholder="多个既往史用逗号隔开" v-model="basicForm.fallAnamnesis"></el-input>
                <!--                <el-select v-model="basicForm.bedAnamnesis" multiple placeholder="请选择" filterable>-->
<!--                  <el-option-->
<!--                    v-for="item in dict.type.he_anamnesis"-->
<!--                    :key="item.value"-->
<!--                    :label="item.label"-->
<!--                    :value="item.value"-->
<!--                  >-->
<!--                  </el-option>-->
<!--                </el-select>-->
              </el-form-item>
              <el-form-item label="该患者本次住院跌倒/坠床第次" prop="fallNumberFalls">
                <el-radio-group v-model="basicForm.fallNumberFalls">
                  <el-radio label="01">第1次</el-radio>
                  <el-radio label="02">第2次</el-radio>
                  <el-radio label="03">第3次</el-radio>
                  <el-radio label="04">>3次</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="意识情况">
                <el-radio-group v-model="basicForm.fallAwarenessSituation">
                  <el-radio label="01">清楚</el-radio>
                  <el-radio label="02">意识障碍</el-radio>
                  <el-radio label="03">定向力障碍</el-radio>
                  <el-radio label="04">躁动</el-radio>
                  <el-radio label="05">半昏迷状态</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="骨骼与肌肉" prop="bedBonesMuscles">
                <el-radio-group v-model="basicForm.bedBonesMuscles">
                  <el-radio label="01">正常</el-radio>
                  <el-radio label="02">关节病变</el-radio>
                  <el-radio label="03">四肢无力</el-radio>
                  <el-radio label="04">偏瘫</el-radio>
                  <el-radio label="05">运动失调</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="使用药物" prop="fallUseMedications">

                <el-select v-model="basicForm.fallUseMedications" placeholder="请选择" filterable>
                  <el-option
                    v-for="item in dict.type.he_use_of_medications"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                    >
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="睡眠情况">
                <el-radio-group v-model="basicForm.fallSleepConditions">
                  <el-radio label="01">好</el-radio>
                  <el-radio label="02">间断入睡</el-radio>
                  <el-radio label="03">失眠</el-radio>
                  <el-radio label="04">服镇静药</el-radio>
                  <el-radio label="05">其他</el-radio>
                </el-radio-group>
              </el-form-item>
<!--              <div v-show="basicForm.drugReaction1== '其他'">-->
<!--                <el-form-item label="其他" style="width: 600px">-->
<!--                  <el-input v-model="basicForm.undesc"></el-input>-->
<!--                </el-form-item>-->
<!--              </div>-->
              <el-form-item label="排泄情况">
                <el-radio-group v-model="basicForm.fallExcretion">
                  <el-radio label="01">正常</el-radio>
                  <el-radio label="02">腹泻</el-radio>
                  <el-radio label="03">尿频</el-radio>
                  <el-radio label="04">大小便失禁</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="其他">
                <el-radio-group v-model="basicForm.fallOther">
                  <el-radio label="01">虚弱</el-radio>
                  <el-radio label="02">Hb<100g/L</el-radio>
                  <el-radio label="03">体位性低血压</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="跌倒/坠床前有无跌倒评估">
                <el-radio-group v-model="basicForm.fallAssessment">
                  <el-radio label="01">是</el-radio>
                  <el-radio label="02">否</el-radio>
                </el-radio-group>
              </el-form-item>
              <div style="color:blue;margin-top: 1%;font-size: 14px">跌倒/坠床环境因素:
              </div>
              <el-form-item label="地面情况">
                <el-checkbox-group v-model="dimian" @change="dimian1(dimian)">
                  <el-checkbox label="01">良好</el-checkbox>
                  <el-checkbox label="02">湿滑</el-checkbox>
                  <el-checkbox label="03">不平</el-checkbox>
                  <el-checkbox label="04">有障碍物</el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <el-form-item label="衣、鞋穿着">
                <el-radio-group v-model="basicForm.fallClothesShoesWear">
                  <el-radio label="01">合适</el-radio>
                  <el-radio label="02">不适合绊倒</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="室内亮度">
                <el-radio-group v-model="basicForm.fallIndoorBrightness">
                  <el-radio label="01">明亮</el-radio>
                  <el-radio label="02">暗</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="呼叫器使用">
                <el-radio-group v-model="basicForm.fallPagerUse">
                  <el-radio label="01">手可取用</el-radio>
                  <el-radio label="02">不能取用</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="伤害程度">
                <el-radio-group v-model="basicForm.fallDegreeDamage">
                  <el-radio label="01">无伤害（0级）</el-radio>
                  <el-radio label="02">轻度伤害（1级）</el-radio>
                  <el-radio label="03">中度伤害（2级）</el-radio>
                  <el-radio label="04">重度伤害（3级）</el-radio>
                  <el-radio label="05">死亡</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="跌倒主要原因" prop="fallCauses">
                <el-checkbox-group v-model="yuanyin" @change="yuanyin1(yuanyin)">
                  <el-checkbox label="01">因患者健康状况而造成</el-checkbox>
                  <el-checkbox label="02">因治疗、药物和（或）麻醉反应而造成</el-checkbox>
                  <el-checkbox label="03">因环境中危险因子而造成</el-checkbox>
                  <el-checkbox label="04">因其他因素而造成</el-checkbox>
                </el-checkbox-group>
              </el-form-item>
              <el-form-item label="跌倒/坠床后处置" prop="fallDisposal">
                <el-checkbox-group v-model="chuli" @change="chuli1(chuli)">
                  <el-checkbox label="01">无</el-checkbox>
                  <el-checkbox label="02">涂药</el-checkbox>
                  <el-checkbox label="03">缝合</el-checkbox>
                  <el-checkbox label="04">影像学检查</el-checkbox>
                  、
                  <el-checkbox label="05">打石膏</el-checkbox>
                  <el-checkbox label="06">牵引</el-checkbox>
                  <el-checkbox label="07">手术</el-checkbox>
                  <el-checkbox label="08">其他</el-checkbox>
                </el-checkbox-group>
              </el-form-item>

            </el-form>

          </div>
        </el-collapse-item>
        <!--      </div>-->

        <!--事件情况描述-->
        <div class="shaodiedaobname" ref="block3"></div>
        <el-collapse-item name="4">
          <template #title>
            <div class="shaodiedaobname">事件情况描述</div>
          </template>
          <div class="block" style="margin-top: 0.5%;">
<!--            描述表单-->
            <el-form ref="reportmiaoshuform" :model="reportForm" :rules="miaoshurule" label-width="140px">
              <el-form-item label="事件描述或事件经过" style="width: 600px" prop="situationEdescriptionProcess">
                <el-input type="textarea" :rows="5" v-model="reportForm.situationEdescriptionProcess" resize="none"
                          placeholder="请输入内容"></el-input>
              </el-form-item>
              <el-form-item label="事件发生时是否采取处理措施" prop="situationMeasuresEvent">
                <el-radio-group v-model="reportForm.situationMeasuresEvent">
                  <el-radio label="01">是</el-radio>
                  <el-radio label="02">否</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item v-if="reportForm.situationMeasuresEvent==='01'" label="采取的处理措施" prop="situationTakenMeasures" style="margin-top: 15px">
                <el-input type="textarea" :rows="5" v-model="reportForm.situationTakenMeasures" resize="none"
                          placeholder="请输入内容"></el-input>
              </el-form-item>
            </el-form>
          </div>
        </el-collapse-item>


        <!--患者资料-->
        <div ref="block4"></div>
        <el-collapse-item name="5">
          <template #title>
            <div class="shaodiedaobname">患者资料</div>
          </template>
          <div class="block" style="margin-top: 0.5%;">
<!--            患者资料表单-->
            <el-form ref="reporthuanzheform" :model="reportForm" :rules="huanzherules" label-width="140px">
              <el-form-item label="是否涉及患者" prop="patientInvolved">
                <el-radio-group v-model="reportForm.patientInvolved">
                  <el-radio label="01">是</el-radio>
                  <el-radio label="02">否</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="诊断类别" prop="patientDiagnosisCategory">
                <el-radio-group v-model="reportForm.patientDiagnosisCategory">
                  <el-radio label="01">急诊</el-radio>
                  <el-radio label="02">门诊</el-radio>
                  <el-radio label="03">住院</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="病历号/门诊号" style="width: 600px" prop="patientRecordOutpatient" :rules="[{max:20, message: '病历号/门诊号不能超过20个字符'},
            {pattern:/^[0-9]+$/, message: '病历号/门诊号必须为数字'}]">
                <el-input v-model="reportForm.patientRecordOutpatient"></el-input>
              </el-form-item>
              <el-form-item label="姓名" style="width: 600px;margin-top: 15px" prop="patientName">
                <el-input v-model="reportForm.patientName"></el-input>
              </el-form-item>
              <el-form-item label="性别" prop="patientGender">
                <el-radio-group v-model="reportForm.patientGender">
                  <el-radio label="01">男</el-radio>
                  <el-radio label="02">女</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item style="margin-top: 15px" label="出生日期" prop="patientDateOfBirth">
                <el-date-picker
                  v-model="reportForm.patientDateOfBirth"
                  type="date"
                  placeholder="选择日期">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="年龄" style="width: 600px;margin-top: 15px" prop="patientAge" :rules="[{pattern:/^-?[1-9]\d{0,2}$/, message: '年龄必须为数字且保持在合理范围内'}]">
                <el-input v-model="reportForm.patientAge"></el-input>
              </el-form-item>
              <el-form-item label="年龄阶段" prop="patientAgeStage" style="margin-top: 15px">
                <el-select v-model="reportForm.patientAgeStage" placeholder="请选择" filterable>
                  <el-option
                    v-for="item in dict.type.he_patient_age_grades"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                   >
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="家属联系电话" style="width: 600px;margin-top: 15px" prop="patientFamilyNumber" :rules="[{pattern:/^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/,message:'电话格式不正确'}]">
                <el-input v-model="reportForm.patientFamilyNumber"></el-input>
              </el-form-item>
              <el-form-item label="入院就诊时间" prop="patientAdmissionTime" style="margin-top: 15px">
                <el-date-picker
                  v-model="reportForm.patientAdmissionTime"
                  type="datetime"
                  placeholder="选择日期时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="床号" style="width: 600px;margin-top: 15px" prop="patientBedNumber" :rules="[{max: 10, message: '床号不能超过10位'},{pattern:/^-?[1-9]\d{0,9}$/, message: '床号必须为数字'}]">
                <el-input v-model="reportForm.patientBedNumber"></el-input>
              </el-form-item>
              <el-form-item label="护理级别" prop="patientNursingLevel">
                <el-radio-group v-model="reportForm.patientNursingLevel">
                  <el-radio label="01">特级护理</el-radio>
                  <el-radio label="02">Ⅰ级护理</el-radio>
                  <el-radio label="03">Ⅱ级护理</el-radio>
                  <el-radio label="04">Ⅲ级护理</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="文化程度" prop="patientEducationLevel">
                <el-radio-group v-model="reportForm.patientEducationLevel">
                  <el-radio label="01">研究生</el-radio>
                  <el-radio label="02">大学本科</el-radio>
                  <el-radio label="03">大学专科</el-radio>
                  <el-radio label="04">中专（中技）</el-radio>
                  <el-radio label="05">高中</el-radio>
                  <el-radio label="06">初中</el-radio>
                  <el-radio label="07">小学</el-radio>
                  <el-radio label="08">文盲</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="诊断(多个诊断之间用逗号隔开)" style="width: 600px" prop="patientDiagnosis">
                <el-input type="textarea" :rows="5" v-model="reportForm.patientDiagnosis" resize="none"
                          placeholder="请输入内容"></el-input>
              </el-form-item>
            </el-form>
          </div>
        </el-collapse-item>
        <!--事件基本信息-->
        <div ref="block5"></div>
        <el-collapse-item name="6">
          <template #title>
            <div class="shaodiedaobname">事件基本信息</div>
          </template>
          <div class="block" style="margin-top: 0.5%;">
<!--            事件基本信息表单-->
            <el-form ref="reportjibenform" :model="reportForm" :rules="jibenrules" label-width="140px">
              <el-form-item label="发生时间" prop="occurrenceTime">
                <el-date-picker
                  v-model="reportForm.occurrenceTime"
                  type="datetime"
                  placeholder="选择日期时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="发生日期" style="margin-top: 15px" prop="occurrenceDate">
                <el-date-picker
                  v-model="reportForm.occurrenceDate"
                  type="date"
                  placeholder="选择日期时间">
                </el-date-picker>
              </el-form-item>
              <el-form-item label="日期类型" style="margin-top: 15px">
                <el-radio-group v-model="reportForm.occurrenceDateType">
                  <el-radio label="工作日"></el-radio>
                  <el-radio label="周末"></el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="发生时段" style="margin-top: 15px">
                <el-radio-group v-model="reportForm.occurrenceTimePeriod">
                  <el-radio label="01">上午(08：00-12：00)</el-radio>
                  <el-radio label="02">中午(12：00-14：00)</el-radio>
                  <el-radio label="03">下午(14：00-18：00)</el-radio>
                  <el-radio label="04">上夜(18：00-00：00)</el-radio>
                  <el-radio label="05">下夜(00：00-08：00)</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="发生地点" style="width: 600px;margin-top: 15px" prop="occurrenceLocation">
                <el-input v-model="reportForm.occurrenceLocation"></el-input>
              </el-form-item>
              <!--上传图片-->
              <el-form-item label="现场照片" prop="images" style="margin-top: 15px">
                <image-upload :limit="1" v-model="reportForm.occurrenceScenePhotos"/>
              </el-form-item>
            </el-form>
          </div>
        </el-collapse-item>


        <!--当事人资料-->
        <div ref="block6"></div>
        <el-collapse-item name="7">
          <template #title>
            <div class="shaodiedaobname">当事人资料</div>
          </template>
          <div class="block" style="margin-top: 0.5%;">
<!--            当事人资料表单-->
            <el-form ref="reportdangshirenform" :model="reportForm" label-width="140px" :rules="dangshirenrules">
              <el-form-item label="姓名" style="width: 600px" prop="partyName">
                <el-input v-model="reportForm.partyName"></el-input>
              </el-form-item>
              <el-form-item label="年龄" style="width: 600px;margin-top: 15px" prop="partyAge" :rules="[{pattern:/^-?[1-9]\d{0,2}$/, message: '年龄必须为数字且保持在合理范围内'}]">
                <el-input v-model="reportForm.partyAge"></el-input>
              </el-form-item>
              <el-form-item label="工作年限" style="margin-top: 15px" prop="partyYearsOfExperience">
                <el-radio-group v-model="reportForm.partyYearsOfExperience">
                  <el-radio label="01"><1年</el-radio>
                  <el-radio label="02">1≤y≤2</el-radio>
                  <el-radio label="03">2≤y≤5</el-radio>
                  <el-radio label="04">5≤y≤10</el-radio>
                  <el-radio label="05">10≤y≤20</el-radio>
                  <el-radio label="06">≥20年</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="类别" style="margin-top: 15px">
                <el-radio-group v-model="reportForm.partyCategory">
                  <el-radio label="01">在编</el-radio>
                  <el-radio label="02">聘用</el-radio>
                  <el-radio label="03">进修</el-radio>
                  <el-radio label="04">实习</el-radio>
                  <el-radio label="05">轮转</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="学历" style="margin-top: 15px">
                <el-radio-group v-model="reportForm.partyEducation">
                  <el-radio label="01">中专</el-radio>
                  <el-radio label="02">大专</el-radio>
                  <el-radio label="03">本科</el-radio>
                  <el-radio label="04">硕士</el-radio>
                  <el-radio label="05">其他</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="职务" style="margin-top: 15px">
                <el-radio-group v-model="reportForm.partyPosition">
                  <el-radio label="01">医疗</el-radio>
                  <el-radio label="02">药剂</el-radio>
                  <el-radio label="03">护理</el-radio>
                  <el-radio label="04">医技</el-radio>
                  <el-radio label="05">检验</el-radio>
                  <el-radio label="06">工程技术</el-radio>
                  <el-radio label="07">行政管理</el-radio>
                  <el-radio label="08">后勤保障</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-form>
          </div>
        </el-collapse-item>

        <!--事件结果-->
        <div ref="block7"></div>
        <el-collapse-item name="8">
          <template #title>
            <div class="shaodiedaobname">事件结果</div>
          </template>
          <div class="block" style="margin-top: 0.5%;">
<!--            事件结果表单-->
            <el-form ref="reportjieguoform" :model="reportForm" :rules="jieguorules" label-width="140px">
              <el-form-item label="纠纷或纠纷隐患可能性" prop="resultsPossibilityDispute">
                <el-radio-group v-model="reportForm.resultsPossibilityDispute">
                  <el-radio label="01">确定有</el-radio>
                  <el-radio label="02">可能有</el-radio>
                  <el-radio label="03">无</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="事件严重程度" prop="resultsEventSeverity" style="margin-top: 15px">
                <el-select v-model="reportForm.resultsEventSeverity" placeholder="请选择" filterable>
                  <el-option
                    v-for="item in dict.type.he_event_severity"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="事件分级" style="width: 600px;margin-top: 15px" prop="resultsEventClassification">
                <el-radio-group v-model="reportForm.resultsEventClassification">
                  <el-radio label="01" style="margin-top: 10px; margin-bottom: 10px">Ⅰ级事件: 发生错误，造成患者死亡 (包括损害程度I级)
                  </el-radio>
                  <el-radio label="02" style="margin-bottom: 10px">Ⅱ级事件: 发生错误，且造成患者伤害 (包括损害程度E、F、G、H级)</el-radio>
                  <el-radio label="03" style="margin-bottom: 10px">Ⅲ级事件: 发生错误，但未造成患者伤害 (包括损害程度B、C、D级)</el-radio>
                  <el-radio label="04">Ⅳ级事件: 错误未发生 (错误隐患)(包括损害程度A级)</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="伤害严重度" prop="resultsSeverityInjury" style="margin-top: 15px">
                <el-radio-group v-model="reportForm.resultsSeverityInjury">
                  <el-radio label="01">死亡</el-radio>
                  <el-radio label="02">极度严重</el-radio>
                  <el-radio label="03">重度</el-radio>
                  <el-radio label="04">中度</el-radio>
                  <el-radio label="05">轻度</el-radio>
                  <el-radio label="06">未造成伤害</el-radio>
                  <el-radio label="07">无伤害</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-form>
          </div>
        </el-collapse-item>

        <!--  报告者信息-->
        <div ref="block8"></div>
        <el-collapse-item name="9">
          <template #title>
            <div class="shaodiedaobname">报告者信息</div>
          </template>
          <div class="block" style="margin-top: 0.5%;">
<!--            报告者信息表单-->
            <el-form ref="reportbaogaoform" :model="reportForm" :rules="baogaorules" label-width="140px">
              <el-form-item label="事件呈报方式" prop="reportMethod">
                <el-radio-group v-model="reportForm.reportMethod">
                  <el-radio label="01">主动呈报</el-radio>
                  <el-radio label="02">投诉</el-radio>
                  <el-radio label="03">他人报告</el-radio>
                  <el-radio label="04">质量检查发现</el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="其他信息备注" style="width: 600px;margin-top: 15px" prop="reportOtherRemarks">
                <el-input type="textarea" :rows="5" v-model="reportForm.reportOtherRemarks" resize="none"
                          placeholder="请输入内容"></el-input>
              </el-form-item>
              <!--上传图片-->
              <el-form-item label="附件图片" prop="reportAttachedImages" style="margin-top: 15px">
                <image-upload :limit="1" v-model="reportForm.reportAttachedImages"/>
              </el-form-item>
            </el-form>
          </div>
        </el-collapse-item>
      </el-collapse>
    </div>

    <!--保存按钮-->
    <div style="position: fixed; margin-top: -0.5%; right: 3%; width: 300px">
      <el-button
        type="primary"
        style="margin-left: 15px"
        @click="baocun"
      >保存
      </el-button>
      <el-button
        type="info" plain
        style="margin-left: 15px"
        @click="fanhui"
      >返回
      </el-button>
    </div>


  </div>

</template>

<script>
  import ScrollPane from "@/layout/components/TagsView/ScrollPane";
  import {addBasic,updateBasic,getBasic} from "@/api/module/shao/shijian/basic";

  export default {
    //定义字典
    dicts: ['he_event_severity','he_patient_age_grades','he_use_of_medications','he_anamnesis'],
    components: {ScrollPane},
    data() {
      // 校验体温方法
      let checktemperature = (rule, value, callback) => {
        var pass = true;
        var pattern = /^([3][5-9](\.\d{1})?|[4][0-1](\.\d{1})?|[4]2(\.0)?|42)$/;
        if (value === '') {
          callback(new Error("体温不能为空"));
          pass = false;
        } else if (!pattern.test(value)) {
          callback(new Error("请填写35-42中的保留一位小数的数值"));
          pass = false;
        }
        if (pass) {
          callback();
        }
      }
      // 校验血压方法
      let checkbp = (rule, value, callback) => {
        var pass = true;
        var patt1 = /^\d+\/\d+$/;
        if (value == '') {
          callback(new Error("血压不能为空"));
          pass = false;
        } else if (!patt1.test(value)) {
          callback(new Error("请分别输入高低压用“/”隔开"));
          pass = false;
        }
        if (pass) {
          callback();
        }
      }
      return {
        activeNames: ['1', '2', '3', '4', '5', '6', '7', '8', '9'],
        //多选项数组
        checkList: [],
        dimian: [],
        yuanyin: [],
        chuli: [],
        formEvent: {
          //代表是事件基本信息表
          heEventBasic: {},
          //代表事件上传信息表
          heEventReport: {},
          //代表事件流程表
          heEventFlow: {},
        },
        //代表事件基本信息表
        basicForm: {
          //这个就是新增到事件基本信息表的跌倒事件
          fallTemperature: '',
          fallPulse: '',
          fallBreathe: '',
          fallBloodPressure: '',
          fallStateConsciousness: '',
          fallDamageCaused: '',
          fallPlace: '',
          fallArea: '',
          fallPosition: '',
          fallMobility: '',
          fallTreatmentConditions: '',
          fallActivityProcess: '',
          fallAnamnesis: '',
          fallNumberFalls: '',
          fallAwarenessSituation: '',
          fallBonesAndMuscles: '',
          fallUseMedications: '',
          fallSleepConditions: '',
          fallExcretion: '',
          fallOther: '',
          fallAssessment: '',
          fallAssessmentTools: '',
          fallEvaluationLevel: '',
          fallEvaluationTime: '',
          fallGroundConditions: '',
          fallClothesShoesWear: '',
          fallIndoorBrightness: '',
          fallPagerUse: '',
          fallDegreeDamage: '',
          fallCauses: '',
          fallDisposal: '',
        },
        // 生命体征的表单校验
        tizhengrules: {
          //限制体温
          fallTemperature: [
            {validator: checktemperature, required: true, trigger: 'blur'}
          ],
          //限制脉搏
          fallPulse: [
            {required: true, message: "脉搏不能为空", trigger: "blur"},
            {min: 1, max: 10, message: '长度在 1-10 个字符', trigger: 'blur'}
          ],
          //限制呼吸
          fallBreathe: [
            {required: true, message: "呼吸不能为空", trigger: "blur"},
            {min: 1, max: 10, message: '长度在 1-10 个字符', trigger: 'blur'}
          ],
          //限制血压
          fallBloodPressure: [
            {validator: checkbp, required: true, trigger: 'blur'},
            {min: 1, max: 10, message: '长度在 1-10 个字符', trigger: 'blur'}
          ],
        },
        hurtrules: {
          //限制部位
          fallPlace: [
            {required: true, message: "部位不能为空", trigger: "blur"},
            {min: 1, max: 50, message: '长度在 1-50 个字符', trigger: 'blur'}
          ],
          //限制面积
          fallArea: [
            {required: true, message: "面积不能为空", trigger: "blur"},
            {min: 1, max: 50, message: '长度在 1-50 个字符', trigger: 'blur'}
          ],
        },
        qingkuangrules: {
          //限制既往史
          fallAnamnesis: [{
            required: true, message: "既往史不能为空", trigger: "change"
          },
            {min: 1, max: 300, message: '长度在 1-300 个字符', trigger: 'blur'}
          ],
          //跌倒坠床次数
          fallNumberFalls: [{
            required: true, message: "跌倒/坠床次数不能为空", trigger: "change"
          }],
          //限制使用药物
          fallUseMedications: [{
            required: true, message: "使用药物不能为空", trigger: "change"
          }],
        },
        miaoshurule: {
          situationEdescriptionProcess: [{
            required: true, message: "事件描述或事件经过不能为空", trigger: "blur"
          },
            {min: 1, max: 1000, message: '长度在 1-1000 个字符', trigger: 'blur'}
          ],
          situationMeasuresEvent: [{
            required: true, message: "事件发生时是否采取处理措施不能为空", trigger: "change"
          }],
          situationTakenMeasures: [{
            required: true, message: "采取的处理措施不能为空", trigger: "blur"
          }],
        },
        huanzherules: {
          //限制姓名
          patientName: [{
            required: true, message: "姓名不能为空", trigger: "blur"
          },
            {min: 1, max: 50, message: '长度在 1-50 个字符', trigger: 'blur'}
          ],
          patientGender: [{
            required: true, message: "性别不能为空", trigger: "change"
          }],
          //限制床号
          patientBedNumber: [{
            required: true, message: "床号不能为空", trigger: "blur"
          },
            {min: 1, max: 50, message: '长度在 1-50 个字符', trigger: 'blur'}
          ],
          patientInvolved: [{
            required: true, message: "是否涉及患者不能为空", trigger: "change"
          }],
          patientDiagnosis: [{
            required: true, message: "诊断不能为空", trigger: "blur"
          },
            {min: 1, max: 500, message: '长度在 1-500 个字符', trigger: 'blur'}
          ],
        },
        jibenrules: {
          //发生时间
          occurrenceTime: [
            {required: true, message: "发生时间不能为空", trigger: "blur"}
          ],
          //发生日期
          occurrenceDate: [
            {required: true, message: "发生日期不能为空", trigger: "blur"}
          ],
          occurrenceLocation: [
            {min: 1, max: 50, message: '长度在 1-50 个字符', trigger: 'blur'}
          ],
        },
        dangshirenrules: {
          partyName: [{
            required: true, message: "当事人资料姓名不能为空", trigger: "blur"
          },
            {
            min: 1, max: 50, message: '长度在 1-50 个字符', trigger: 'blur'}
          ],
        },
        jieguorules: {
          //限制事件分级
          resultsEventClassification: [{
            required: true, message: "事件分级不能为空", trigger: 'change'
          }],
          //限制事件严重程度
          resultsEventSeverity: [{
            required: true, message: "事件严重程度不能为空", trigger: 'change'
          }],
          //限制伤害严重度
          resultsSeverityInjury: [{
            required: true, message: "伤害严重度不能为空", trigger: 'change'
          }],
        },
        baogaorules: {
          reportMethod: [{
            required: true, message: "事件呈报方式不能为空", trigger: 'change'
          }],
        },
        //代表事件上报信息表
        reportForm: {
          reportEventType: '01',
          reviewEventType: '01',
          //以下都是新增到事件上传信息表的字段
          //事件情况描述
          situationEdescriptionProcess: '',
          situationMeasuresEvent: '',
          situationTakenMeasures: '',
          situationCausesconsequences: '',
          //患者资料
          patientInvolved: '',
          patientDiagnosisCategory: '',
          patientRecordOutpatient: '',
          patientName: '',
          patientGender: '',
          patientDateOfBirth: '',
          patientAge: '',
          patientAgeStage: '',
          patientEthnicGroup: '',
          patientWeight: '',
          patientPreDisease: '',
          patientContact: '',
          patientFamilyNumber: '',
          patientAdmissionTime: '',
          patientDepartment: '',
          patientBedNumber: '',
          patientNursingLevel: '',
          patientEducationLevel: '',
          patientDiagnosis: '',
          //其他情况暂时没有字段以后加这里先写死
          //事件基本信息
          occurrenceTime: '',
          occurrenceDate: '',
          occurrenceDateType: '',
          occurrenceTimePeriod: '',
          occurrenceLocation: '',
          occurrenceScenePhotos: '',
          //当事人资料
          partyName: '',
          partyAge: '',
          partyYearsOfExperience: '',
          partyCategory: '',
          partyEducation: '',
          partyPosition: '',
          partyPost: '',
          //事件结果
          resultsPossibilityDispute: '',
          resultsEventSeverity: '',
          resultsEventClassification: '',
          resultsSeverityInjury: '',
          //报告者信息(上报信息)
          reportMethod: '',
          reportAttachedImages: '',
          reportOtherRemarks: '',
          note1: '',
        },
        //代表事件流程表
        flowForm: {},
      }
    },
    // 禁止web端屏幕缩放
    created() {
      this.formEvent.heEventReport.id = this.$route.query.id;
      if(this.formEvent.heEventReport.id){
        getBasic(this.formEvent.heEventReport.id).then(response => {
          //获取后台传过来的表单
          this.formEvent = response.data;
          //将其对应赋值进行表单渲染
          this.basicForm=this.formEvent.heEventBasic
          this.reportForm=this.formEvent.heEventReport
          this.xian();
        });
      }
      // window.addEventListener("mousewheel", function (event) {
      //   if (event.ctrlKey === true || event.metaKey) {
      //     event.preventDefault();
      //   }
      // }, {passive: false})
    },
    methods: {
      xian(){
        //用于多选框反显
        this.checkList=this.pushCheckbox(this.basicForm.bedTreatmentConditions)
        this.yuanyin=this.pushCheckbox(this.basicForm.fallCauses)
        this.chuli=this.pushCheckbox(this.basicForm.fallDisposal)
        this.dimian=this.pushCheckbox(this.basicForm.fallGroundConditions)
      },
      //用于多选框反显,如果str不为空则执行通过','切割操作否则将其置为空初始化
      pushCheckbox(str){
        if(str!=null){
          const boxlist=str.split(',');
          return boxlist;
        }else {
          return [];
        }
      },
      //返回按钮
      fanhui() {
        if (this.formEvent.heEventReport.id != null){
          this.$router.push({path: "/hosipitalevent/caogaoshijian"});
        }else{
          this.$router.push({path: "/hosipitalevent/report"});
        }
      },
      //以下均是添加时需要切割的方法
      chuli1(boxlist) {
        this.basicForm.fallDisposal = this.popCheckbox(boxlist);
      },
      dimian1(boxlist) {
        this.basicForm.fallGroundConditions = this.popCheckbox(boxlist);
      },
      yuanyin1(boxlist) {
        this.basicForm.fallCauses = this.popCheckbox(boxlist);
      },
      outputSelectedValues(boxlist) {
        this.basicForm.bedTreatmentConditions = this.popCheckbox(boxlist);
      },
      //用于添加时进行切割
      popCheckbox(boxlist) {
        let str = '';
        for (let i = 0; i < boxlist.length; i++) {
          if (i == 0) {
            str = boxlist[i];
          } else {
            str = str + ',' + boxlist[i];
          }
        }
        return str;
      },
      //保存按钮事件
      baocun() {
        //验证体征表单中的内容
        this.$refs["basictizhengform"].validate(valid => {
          if (valid) {
            //验证伤害表单中的内容
            this.$refs["basichurtform"].validate(valid => {
              if (valid) {
                //验证跌倒/坠床其他情况表单中的内容
                this.$refs["basicqingkuangform"].validate(valid => {
                  if (valid) {
                    //验证事件情况描述表单中的内容
                    this.$refs["reportmiaoshuform"].validate(valid => {
                      if (valid) {
                        //验证患者资料表单中的内容
                        this.$refs["reporthuanzheform"].validate(valid => {
                          if (valid) {
                            //验证事件基本信息表单中的内容
                            this.$refs["reportjibenform"].validate(valid => {
                              if (valid) {
                                //验证当事人资料表单中的内容
                                this.$refs["reportdangshirenform"].validate(valid => {
                                  if (valid) {
                                    //验证事件结果表单中的内容
                                    this.$refs["reportjieguoform"].validate(valid => {
                                      if (valid) {
                                        //验证事件报告者信息表单中的内容
                                        this.$refs["reportbaogaoform"].validate(valid => {
                                          if (valid) {
                                            //出生日期
                                            if (this.reportForm.patientDateOfBirth !== null) {
                                              this.reportForm.patientDateOfBirth = this.reportForm.patientDateOfBirth.toLocaleString('zh-CN', {timeZone: 'Asia/Shanghai',hour12: false})
                                              this.reportForm.patientDateOfBirth= this.reportForm.patientDateOfBirth.replace(/\//g, '-')
                                            }
                                            // 入诊就诊时间
                                            if (this.reportForm.patientAdmissionTime !== null) {
                                              this.reportForm.patientAdmissionTime = this.reportForm.patientAdmissionTime.toLocaleString('zh-CN', {timeZone: 'Asia/Shanghai',hour12: false})
                                              this.reportForm.patientAdmissionTime= this.reportForm.patientAdmissionTime.replace(/\//g, '-')
                                            }
                                            //发生时间
                                            if (this.reportForm.occurrenceTime !== null) {
                                              this.reportForm.occurrenceTime = this.reportForm.occurrenceTime.toLocaleString('zh-CN', {timeZone: 'Asia/Shanghai',hour12: false})
                                              this.reportForm.occurrenceTime= this.reportForm.occurrenceTime.replace(/\//g, '-')
                                            }
                                            //发生日期
                                            if (this.reportForm.occurrenceDate !== null) {
                                              this.reportForm.occurrenceDate = this.reportForm.occurrenceDate.toLocaleString('zh-CN', {timeZone: 'Asia/Shanghai',hour12: false})
                                              this.reportForm.occurrenceDate= this.reportForm.occurrenceDate.replace(/\//g, '-')
                                            }
                                            this.reportForm.note1 = "跌倒事件"
                                            //将代表事件上报信息表的字段内容赋值给heEventReport对象用于连接后台
                                            this.formEvent.heEventReport = this.reportForm
                                            //将代表事件基本信息表的字段内容赋值给heEventReport对象用于连接后台
                                            this.formEvent.heEventBasic = this.basicForm
                                            //将代表事件基本信息表的字段内容赋值给heEventReport对象用于连接后台
                                            this.formEvent.heEventFlow = this.flowForm
                                            //如果能查到该条数据则执行修改
                                            if (this.formEvent.heEventReport.id!= null) {
                                              updateBasic(this.formEvent).then(response => {
                                                this.$modal.msgSuccess("修改成功");
                                                this.$router.push({path: "/hosipitalevent/caogaoshijian"});
                                              });
                                            } else {
                                              //否则执行新增
                                              addBasic(this.formEvent).then(response => {
                                                this.$modal.msgSuccess("事件创建成功，请进入并呈送事件！");
                                                // this.$router.push({path: "/index"});
                                                this.$router.push({path: "/hosipitalevent/caogaoshijian"});//跳转到呈送页面
                                              });
                                            }
                                          }
                                        })
                                      }
                                    })
                                  }
                                })
                              }
                            })
                          }
                        })
                      }
                    })
                  }
                })
              }
            })
          }
        });
      },
      //回到浏览器顶端防止出现滑动过快问题
      ding() {
        window.scrollTo(0, 0);
      },
      //el 标签  speed 滚动速率 此处是50px 值越大滚动的越快
      goAssignBlock(el, speed) {
        let t = this.$refs[el].offsetTop - 100

        function scrollToTop() {
          let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;

          if (scrollTop > t) {
            window.scrollTo(0, scrollTop - speed);

            // 使用 requestAnimationFrame 进行平滑滚动
            requestId = window.requestAnimationFrame(scrollToTop);
          } else {
            window.scrollTo(0, t);

            // 取消动画帧的请求
            window.cancelAnimationFrame(requestId);
          }
        }
        let requestId = window.requestAnimationFrame(scrollToTop);
      },
    },

  }

</script>

<style lang="scss" scoped>
@import "src/views/module/shao/blackFont";

  .sidebar {
    margin-left: 3%;
    width: 10%;
    float: left;
    display: flex;
  }

  .content {
    margin-left: 3%;
    margin-right: 1.5%;
    width: 87%;
    float: right;
  }

  .btn-box {
    position: fixed;
    margin-top: 1%;

    ::v-deep .el-card__body {
      padding: 15px 15px 15px 5px;
    }
  }

  .btn-box button {
    text-align: left;
    padding: 0 0 0 10px;
    display: block;
    width: 150px;
    height: 40px;
    border: none;
    cursor: pointer;
  }

  .btn-box button:hover {
    background: hsl(221, 98%, 68%);
    color: white;
  }

  .block {
    border: 1px solid white;
    width: 100%;
    height: 100%;
    display: flex;
    font-size: 5rem;
    box-sizing: border-box;

    .el-form-item {
      margin-bottom: 10px;
    }
  }

  .shaodiedaobname {
    font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
    font-weight: bold;
    font-size: 20px;
    color: black;
  }
</style>
